<template>
    {{ root.count }} -- {{ root.msg }}
    <el-button @click="handlClick">click</el-button>
</template>

<script>
import { inject } from 'vue';

export default {
    setup () {
        const root = inject('root');
        // console.log(root);
        const handlClick = () => {
            root.count += 1;
            root.msg = 'ls';
            root.addCount();
        };
        return {
            root, handlClick,
        };
    },
};
</script>

<style>

</style>
